package cn.control;

import java.io.IOException;

import javax.servlet.RequestDispatcher;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import cn.dao.hotel_baseDao;
import cn.pojo.hotel_base;



public class Hotle_add extends HttpServlet{
	
@Override
protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
	// TODO Auto-generated method stub
	hotel_base base = new hotel_base();
	base.setHB_id(req.getParameter("HB_id"));
	base.setHB_url(req.getParameter("HB_url"));
	base.setHB_phone(req.getParameter("hB_phone"));
	base.setHB_exmail(req.getParameter("hB_exmail"));
	base.setHB_profile(req.getParameter("hB_profile"));
	
	hotel_baseDao adddao =new hotel_baseDao();
	boolean add=false;
	try {
		add=adddao.addHotel_Base(base);
	} catch (Exception e) {
		// TODO: handle exception
		e.printStackTrace();
	}
	RequestDispatcher rd=req.getRequestDispatcher("p");
	rd.forward(req, resp);
	
	
}

@Override
	protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
		// TODO Auto-generated method stub
		doGet(req, resp);
	}
	
	
	

}
